import com.sun.org.apache.xerces.internal.impl.dv.xs.DecimalDV;

import java.lang.reflect.Array;
import java.text.DecimalFormat;
import java.util.Scanner;

/**
 *
 * Created by jyo on 15-8-28.
 */
public class Retirement2 {



    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

//        System.out.println("How much money do you need to retire");
//        double goal = in.nextDouble();

        System.out.println("How much money will you contribute every year?");
        double payment = in.nextDouble();

        System.out.println("Interest rate in %:");
        double interestRate = in.nextDouble();

        double balance=0;int years=0;
        String input;
        int[] arys = new int[] {1,2,3,4,5};
        System.out.println(arys[0]);
        do{
//            if (years>0){
                balance             += payment;
//            }

            double interrest    = balance * interestRate / 100;
            balance             += interrest;

            years++;

            System.out.printf("After year %s,ur balance is %,.2f%n",years,balance);
            System.out.println("Ready to retire? (Y/N)");
            input   = in.next();
        }

        while (input.equals("N"));
    }


}
